//package com.gfxy.modules.teaching.service.impl;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.gfxy.modules.common.entity.MemberList;
//import com.gfxy.modules.common.mapper.MemberListMapper;
//import com.gfxy.modules.teaching.entity.Zxjpk;
//
//import com.gfxy.modules.teaching.mapper.GfxyTZxjpkMapper;
//import com.gfxy.modules.teaching.service.IGfxyTZxjpkService;
//import com.gfxy.modules.teaching.vo.GfxyTZxjpakMenberPage;
//import com.gfxy.modules.teaching.vo.GfxyTZxjpkPage;
//import com.gfxy.modules.util.ExcelUtil;
//import org.apache.poi.ss.usermodel.Row;
//import org.apache.poi.ss.usermodel.Sheet;
//import org.apache.poi.ss.usermodel.Workbook;
//import org.apache.poi.ss.usermodel.WorkbookFactory;
//import org.springframework.beans.BeanUtils;
//import org.springframework.stereotype.Service;
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.multipart.MultipartFile;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.PushbackInputStream;
//import java.io.Serializable;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Collection;
//
///**
// * @Description: 在线精品课
// * @Author: jeecg-boot
// * @Date:   2021-08-23
// * @Version: V1.0
// */
//@Service
//public class GfxyTZxjpkServiceImpl extends AbstractProjectServiceImpl<GfxyTZxjpkMapper, Zxjpk> implements IGfxyTZxjpkService {
//
////
////	@Override
////	public List<String> importExcel(MultipartFile file)throws IOException {
////		List<String> result = new ArrayList<>();
////		InputStream inputStream = file.getInputStream();
////		if (!(inputStream).markSupported()) {
////			inputStream = new PushbackInputStream(inputStream, 8);
////		}
////
////		Workbook workbook = WorkbookFactory.create(inputStream);
////		Sheet sheetAt = workbook.getSheetAt(0);
////		String projectName = "";
////
////		List<GfxyTZxjpkPage> list = new ArrayList<>();
////		for (int i = 1; i < sheetAt.getLastRowNum(); i++) {
////
////			Row row = sheetAt.getRow(i);
//////
////			String classess = ExcelUtil.formatCell(row.getCell(0));
////			String startTime = ExcelUtil.formatCell(row.getCell(1));
////			String endTime = ExcelUtil.formatCell(row.getCell(2));
////			String className = ExcelUtil.formatCell(row.getCell(3));
//////
//////			@ApiModelProperty(value = "成员列表")
//////			private List<MemberList> memberListList;
////			GfxyTZxjpkPage gfxyTZxjpkPage = new GfxyTZxjpkPage();
////			gfxyTZxjpkPage.setClassess(this.translateClassess(classess));
////			gfxyTZxjpkPage.setStartTime(startTime);
////			gfxyTZxjpkPage.setEndTime(endTime);
////			gfxyTZxjpkPage.setClassName(className);
////			String members = ExcelUtil.formatCell(row.getCell(4));
////			String[] memberArray = members.split("、");
////			List<MemberList> memberListList = new ArrayList<>();
////			for (int j = 0; j < memberArray.length; j++) {
////				String memberStr = memberArray[j];
////				System.out.println(members);
////				List<MemberList> memberLists = memberListMapper.selectByRealName(memberStr.trim());
////				System.out.println("wangying");
////				System.out.println(memberLists);
//////				if(memberLists.size()==1){
//////
//////					MemberList memberList = memberLists.get(0);
//////					memberList.setRanked(j+1);
//////					memberList.setProjectType("2");
//////					memberList.setIsCustom("0");
//////					memberList.setProportion(ExcelUtil.computeProportion(j+1,memberArray.length));
//////					memberListList.add(memberList);
//////
//////				} else if(memberLists.size() == 0){
//////
//////					result.add(gfxyTZxjpkPage.getClassName() + "中，教师:" + memberStr+"不存在请手动添加");
//////					MemberList memberList = new MemberList();
//////					memberList.setRanked(j+1);
//////					memberList.setProjectType("2");
//////					memberList.setIsCustom("0");
//////					memberList.setProportion(ExcelUtil.computeProportion(j+1,memberArray.length));
//////					memberListList.add(memberList);
//////				} else if(memberLists.size()>1){
//////
//////					result.add(gfxyTZxjpkPage.getClassName() + "-中，教师:" + memberStr + " 存在同名教师，请手动处理");
//////					MemberList memberList = new MemberList();
//////					memberList.setRanked(j+1);
//////					memberList.setProjectType("2");
//////					memberList.setIsCustom("0");
//////					memberList.setProportion(ExcelUtil.computeProportion(j+1,memberArray.length));
//////					memberListList.add(memberList);
//////				}
////
////			}
////			gfxyTZxjpkPage.setMemberListList(memberListList);
////			list.add(gfxyTZxjpkPage);
////
////		}
////		for (GfxyTZxjpkPage page : list) {
////			Zxjpk zxjpk = new Zxjpk();
////			BeanUtils.copyProperties(page, zxjpk);
////			this.saveMain(zxjpk, page.getMemberListList());
////		}
////		return result;
////	}
//	private int translateClassess(String name){
//		if(name == null || name.equals("")){
//			return 0;
//		} else if(name.equals("国家级")){
//			return 1;
//		} else if(name.equals("省级")){
//			return 2;
//		} else if(name.equals("校级")){
//			return 3;
//		} else {
//			return 0;
//		}
//	}
//
//	@Override
//	protected void pass(String id, String isPass) {
//
//	}
//
//	@Override
//	protected Zxjpk getOneProject(Row row) {
//		return null;
//	}
//
//	@Override
//	public Double getTotalScore(Zxjpk zxjpk) {
//		return null;
//	}
//
//	@Override
//	public Double[] getMemberListScore(double totalScore, int memberNum) {
//		return new Double[0];
//	}
//}
